import logo from "./logo.svg";
import "./App.css";
import { BrowserRouter as Router, Switch, Link, Route } from "react-router-dom";

import { createBrowserHistory } from "history";
function User(...props) {
  console.log(props);

  return <div>user</div>;
}
function App() {
  return (
    <div className="App">
      <Router>
        <>
          <User />
          <nav>
            <ul>
              <li>
                <Link to="/">Home</Link>
              </li>
              <li>
                <Link to="/about">About</Link>
              </li>
              <li>
                <Link to="/user/3">user3</Link>
              </li>
              <li>
                <Link to="/user/4">user4</Link>
              </li>
            </ul>
          </nav>

          <Switch>
            <Route exact path="/">
              <button
                onClick={() => {
                  console.log(window.a.b);
                }}
              >
                click
              </button>
            </Route>

            <Route path="/about">about</Route>
            <Route path="/user/:id" component={User} />
          </Switch>
        </>
      </Router>
    </div>
  );
}

export default App;
